// 画作相关的类型定义

// 画笔设置接口
export interface BrushSettings {
  size: number;
  color: string;
  opacity: number;
  tool: 'brush' | 'eraser' | 'spray';
}

// 画作类型
export type DrawingType = 'bird' | 'boat' | 'fish';

// 画作接口
export interface Drawing {
  id: number;
  title: string;
  imageData: string; // base64 图片数据
  drawingType: DrawingType;
  aiPrediction?: string;
  aiAccuracy?: number;
  canvasWidth: number;
  canvasHeight: number;
  brushSettings: BrushSettings;
  isPublic: boolean;
  tags?: string;
  user: {
    id: number;
    username: string;
    email: string;
  };
  createdAt: string;
  updatedAt: string;
}

// 创建画作的请求数据
export interface CreateDrawingRequest {
  title: string;
  imageData: string;
  drawingType: DrawingType;
  aiPrediction?: string;
  aiAccuracy?: number;
  canvasWidth: number;
  canvasHeight: number;
  brushSettings: BrushSettings;
  isPublic?: boolean;
  tags?: string;
  user?: number; // 用户ID，用于明确指定用户关联
}

// 更新画作的请求数据
export interface UpdateDrawingRequest extends Partial<CreateDrawingRequest> {
  id: number;
}

// API 响应数据
export interface DrawingResponse {
  data: Drawing;
  meta?: any;
}

export interface DrawingsResponse {
  data: Drawing[];
  meta: {
    pagination: {
      page: number;
      pageSize: number;
      pageCount: number;
      total: number;
    };
  };
}

// 本地存储的画作数据（兼容旧版本）
export interface LocalDrawing {
  id: string;
  title: string;
  imageData: string;
  timestamp: number;
  drawingType?: DrawingType;
  aiPrediction?: string;
  aiAccuracy?: number;
}